//
//  UIViewController+TapGesture.m
//  
//
//  Created by 张领瑞 on 2017/8/31.
//
//

#import "UIViewController+TapGesture.h"

@implementation UIViewController (TapGesture)
-(void)addTapGestureForViewControllerToRecoverKeyboard{
    //  点击空白收起keyboard self.view添加手势
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapped:)];
    tap1.cancelsTouchesInView = NO;
    [self.view addGestureRecognizer:tap1];
}

//  点击空白收起keyboard
-(void)viewTapped:(UITapGestureRecognizer*)sender{
    
    [self.view endEditing:YES];
}
@end
